import {
    get,
    post,
    postExcel,
    getExcel
} from '../utils/request.js';

/* 用户 */
export const addUser = (params) => post('/b/privs/user/addUser', params);
export const addCaUser = (params) => post('/b/privs/user/addCaUser', params);
export const getUser = (params) => post('/b/privs/user/userGrid', params);
export const upUser = (params) => post('/b/privs/user/upUser', params);
export const upCaUser = (params) => post('/b/privs/user/upCaUser', params);
export const delUser = (params) => post('/b/privs/user/delUser', params);

export const getPrintBk = () => post('/qyxx/copic/getPrintBk');
//获取二维码
export const getCaCode = (params) => post('/b/privs/user/getCaCode', params);

/* 角色 */
export const addRole = (params) => post('/b/privs/role/addRole', params);
export const getRole = (params) => post('/b/privs/role/roleGrid', params);
export const upRole = (params) => post('/b/privs/role/upRole', params);
export const delRole = (params) => post('/b/privs/role/delRole', params);
export const getRoleDown = () => post('/b/privs/role/getRole');


/* 机构  */
export const addOrg = (params) => post('/b/privs/org/addOrg', params);
export const getOrg = (params) => post('/b/privs/org/orgGrid', params);
export const orgGridList = (params) => post('/b/privs/org/orgGridList', params);
export const relatTree = (params) => post('/qyxx/relat/relatTree', params);
export const upOrg = (params) => post('/b/privs/org/upOrg', params);
export const delOrg = (params) => post('/b/privs/org/delOrg', params);


/* 资源 */
export const addRes = (params) => post('/b/privs/res/addRes', params);
export const getRes = (params) => post('/b/privs/res/resGrid', params);
export const upRes = (params) => post('/b/privs/res/upRes', params);
export const delRes = (params) => post('/b/privs/res/delRes', params);
/* 资源下拉tree */
export const getResTree = (params) => post('/b/privs/res/resTree', params);

/* 根据角色id获取路由权限 */
export const getRoutes = (params) => post('/b/privs/roleres/getRoleRes', params);

/* 获取动态路由接口 */
export const getResTree01 = () => post('/b/privs/res/getResTree');
/* 分配权限 */
export const upAuthor = (params) => post('/b/privs/roleres/upRoleres', params);
export const getOnRes = (params) => post('/b/privs/roleres/roleresList', params);
/* 获取所有按钮权限数据 */
export const getBtn = (params) => post('/b/privs/user/userButton', params);

/* 字典 & 属性 */
export const addDict = (params) => post('/b/privs/dict/addDict', params);
export const getDict = (params) => post('/b/privs/dict/dictGrid', params);
export const upDict = (params) => post('/b/privs/dict/upDict', params);
export const delDict = (params) => post('/b/privs/dict/delDict', params);

export const addField = (params) => post('/b/privs/field/addField', params);
export const getField = (params) => post('/b/privs/field/fieldGrid', params);
export const upField = (params) => post('/b/privs/field/upField', params);
export const delField = (params) => post('/b/privs/field/delField', params);
export const delFields = (params) => post('/b/privs/field/delFieldBatch', params);


/* 角色分配 & 回显角色 */
export const roleList = (params) => post('/b/privs/roleuser/roleuserList', params);
export const dRole = (params) => post('/b/privs/roleuser/upRoleuser', params);
//查询当前用户角色类型
export const getRoleType = (params) => get('/customer/zxdz/getRoleType', params);
/* 日志 */
export const getLog = (params) => post('/b/privs/log/logGrid', params);

/* 帮助 */
export const downloadUserManual = (params) => getExcel('/qyxx/authorize/downloadUserManual', params);
export const downloadNtSoft = (params) => getExcel('/qyxx/authorize/downloadNtSoft', params);
export const downloadSqxyTemp = (params) => getExcel('/qyxx/authorize/downloadSqxyTemp', params);
//黑名单客户模板下载
export const downloadTemp = (params) => getExcel('/customer/black/downloadTemp', params);
